factoring polynomials by taking out commob factor